<?php

namespace App\Http\Controllers\Customer\Api;

use App\Facades\UserService;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class UserController extends Controller
{
	public function updateUserInfo(Request $request)
	{
		$rules = [
			'name' => 'required',
			'sex' => 'required',
			'phone' => 'required|telephone',
			'installation_address' => 'required',
		];
		$this->validate($request, $rules);

		UserService::updateUserInfo($request->only([
			'name',
			'sex',
			'phone',
			'installation_address',
			]));
		return formatJsonResponse();
	}
}
